import React, { Component } from 'react';
import './item.css';
class item extends Component {
    render() {
        let {list,data} = this.props
        return (
            <div>
                <ul>
                    {/* 遍历渲染 */}
                    {list.map((res,index) => (
                        <li key={index}>
                            {res} <button onClick={()=>data(index)}>删除</button>
                        </li> 
                    ))}
                </ul>
            </div>
        );
    }
}

export default item;
